package com.yanqu.road.server.manger.activity.shanshui;

import com.yanqu.road.entity.activity.youxing.XingYouShanShuiUserData;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.shanshui.XingYouShanShuiModule;
import com.yanqu.road.server.manger.activity.IActivityMallLimitHandler;

public class XingYouActivityBuyLimit implements IActivityMallLimitHandler {

    @Override
    public boolean isBuyLimit(GamePlayer player, int mallId, int activityId, String param, int count) {
        XingYouShanShuiUserData userData = player.getModule(XingYouShanShuiModule.class).getUserData();
        if(userData == null || userData.getActivityId() != activityId){
            return false;
        }
        if(userData.getTotalEnergy() < Integer.parseInt(param)){
            return true;
        }
        return false;
    }
}
